package com.yiyahui.framework.aspectj.lang.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yiyahui.framework.aspectj.lang.enums.SensitiveTypeEnum;
import com.yiyahui.framework.config.SensitiveInfoSerializer;

@Target({ ElementType.FIELD, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveInfoSerializer.class)
public @interface Desensitized {
    /*脱敏类型(规则)*/
    SensitiveTypeEnum type();
    /*判断注解是否生效的方法*/
    String isEffictiveMethod() default "";
    /**
     * 附加值, 自定义正则表达式等
     * @return
     */
    String[] attach() default "";
}